import React, { Component } from 'react'

import {
  Alert,
  Spin
} from 'antd'

import style from './index.less'

// 路由组件loading

export default function App ({ error, pastDelay }) {
  if (error) {
    return <Alert className = { style['alert'] } message = '加载失败' showIcon type = 'error' />
  } else if (pastDelay) {
    return <div className = { style['wrap'] }><Spin className = { style['loading'] } /></div>
  }

  return null
}
